package com.raining.inningz.database.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.raining.inningz.database.dao.Subscriptions;
import com.raining.inningz.database.dao.MatchDetails;
import com.raining.inningz.database.dao.MatchResults;
import com.raining.inningz.database.dao.ActionCommentary;
import com.raining.inningz.database.dao.ScoreLine;
import com.raining.inningz.database.dao.ScoringTemplates;
import com.raining.inningz.database.dao.Player;
import com.raining.inningz.database.dao.BattingSummary;
import com.raining.inningz.database.dao.BowlingSummary;
import com.raining.inningz.database.dao.ExtrasSummary;
import com.raining.inningz.database.dao.MatchInnings;
import com.raining.inningz.database.dao.Matches;

import com.raining.inningz.database.dao.SubscriptionsDao;
import com.raining.inningz.database.dao.MatchDetailsDao;
import com.raining.inningz.database.dao.MatchResultsDao;
import com.raining.inningz.database.dao.ActionCommentaryDao;
import com.raining.inningz.database.dao.ScoreLineDao;
import com.raining.inningz.database.dao.ScoringTemplatesDao;
import com.raining.inningz.database.dao.PlayerDao;
import com.raining.inningz.database.dao.BattingSummaryDao;
import com.raining.inningz.database.dao.BowlingSummaryDao;
import com.raining.inningz.database.dao.ExtrasSummaryDao;
import com.raining.inningz.database.dao.MatchInningsDao;
import com.raining.inningz.database.dao.MatchesDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig subscriptionsDaoConfig;
    private final DaoConfig matchDetailsDaoConfig;
    private final DaoConfig matchResultsDaoConfig;
    private final DaoConfig actionCommentaryDaoConfig;
    private final DaoConfig scoreLineDaoConfig;
    private final DaoConfig scoringTemplatesDaoConfig;
    private final DaoConfig playerDaoConfig;
    private final DaoConfig battingSummaryDaoConfig;
    private final DaoConfig bowlingSummaryDaoConfig;
    private final DaoConfig extrasSummaryDaoConfig;
    private final DaoConfig matchInningsDaoConfig;
    private final DaoConfig matchesDaoConfig;

    private final SubscriptionsDao subscriptionsDao;
    private final MatchDetailsDao matchDetailsDao;
    private final MatchResultsDao matchResultsDao;
    private final ActionCommentaryDao actionCommentaryDao;
    private final ScoreLineDao scoreLineDao;
    private final ScoringTemplatesDao scoringTemplatesDao;
    private final PlayerDao playerDao;
    private final BattingSummaryDao battingSummaryDao;
    private final BowlingSummaryDao bowlingSummaryDao;
    private final ExtrasSummaryDao extrasSummaryDao;
    private final MatchInningsDao matchInningsDao;
    private final MatchesDao matchesDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        subscriptionsDaoConfig = daoConfigMap.get(SubscriptionsDao.class).clone();
        subscriptionsDaoConfig.initIdentityScope(type);

        matchDetailsDaoConfig = daoConfigMap.get(MatchDetailsDao.class).clone();
        matchDetailsDaoConfig.initIdentityScope(type);

        matchResultsDaoConfig = daoConfigMap.get(MatchResultsDao.class).clone();
        matchResultsDaoConfig.initIdentityScope(type);

        actionCommentaryDaoConfig = daoConfigMap.get(ActionCommentaryDao.class).clone();
        actionCommentaryDaoConfig.initIdentityScope(type);

        scoreLineDaoConfig = daoConfigMap.get(ScoreLineDao.class).clone();
        scoreLineDaoConfig.initIdentityScope(type);

        scoringTemplatesDaoConfig = daoConfigMap.get(ScoringTemplatesDao.class).clone();
        scoringTemplatesDaoConfig.initIdentityScope(type);

        playerDaoConfig = daoConfigMap.get(PlayerDao.class).clone();
        playerDaoConfig.initIdentityScope(type);

        battingSummaryDaoConfig = daoConfigMap.get(BattingSummaryDao.class).clone();
        battingSummaryDaoConfig.initIdentityScope(type);

        bowlingSummaryDaoConfig = daoConfigMap.get(BowlingSummaryDao.class).clone();
        bowlingSummaryDaoConfig.initIdentityScope(type);

        extrasSummaryDaoConfig = daoConfigMap.get(ExtrasSummaryDao.class).clone();
        extrasSummaryDaoConfig.initIdentityScope(type);

        matchInningsDaoConfig = daoConfigMap.get(MatchInningsDao.class).clone();
        matchInningsDaoConfig.initIdentityScope(type);

        matchesDaoConfig = daoConfigMap.get(MatchesDao.class).clone();
        matchesDaoConfig.initIdentityScope(type);

        subscriptionsDao = new SubscriptionsDao(subscriptionsDaoConfig, this);
        matchDetailsDao = new MatchDetailsDao(matchDetailsDaoConfig, this);
        matchResultsDao = new MatchResultsDao(matchResultsDaoConfig, this);
        actionCommentaryDao = new ActionCommentaryDao(actionCommentaryDaoConfig, this);
        scoreLineDao = new ScoreLineDao(scoreLineDaoConfig, this);
        scoringTemplatesDao = new ScoringTemplatesDao(scoringTemplatesDaoConfig, this);
        playerDao = new PlayerDao(playerDaoConfig, this);
        battingSummaryDao = new BattingSummaryDao(battingSummaryDaoConfig, this);
        bowlingSummaryDao = new BowlingSummaryDao(bowlingSummaryDaoConfig, this);
        extrasSummaryDao = new ExtrasSummaryDao(extrasSummaryDaoConfig, this);
        matchInningsDao = new MatchInningsDao(matchInningsDaoConfig, this);
        matchesDao = new MatchesDao(matchesDaoConfig, this);

        registerDao(Subscriptions.class, subscriptionsDao);
        registerDao(MatchDetails.class, matchDetailsDao);
        registerDao(MatchResults.class, matchResultsDao);
        registerDao(ActionCommentary.class, actionCommentaryDao);
        registerDao(ScoreLine.class, scoreLineDao);
        registerDao(ScoringTemplates.class, scoringTemplatesDao);
        registerDao(Player.class, playerDao);
        registerDao(BattingSummary.class, battingSummaryDao);
        registerDao(BowlingSummary.class, bowlingSummaryDao);
        registerDao(ExtrasSummary.class, extrasSummaryDao);
        registerDao(MatchInnings.class, matchInningsDao);
        registerDao(Matches.class, matchesDao);
    }
    
    public void clear() {
        subscriptionsDaoConfig.getIdentityScope().clear();
        matchDetailsDaoConfig.getIdentityScope().clear();
        matchResultsDaoConfig.getIdentityScope().clear();
        actionCommentaryDaoConfig.getIdentityScope().clear();
        scoreLineDaoConfig.getIdentityScope().clear();
        scoringTemplatesDaoConfig.getIdentityScope().clear();
        playerDaoConfig.getIdentityScope().clear();
        battingSummaryDaoConfig.getIdentityScope().clear();
        bowlingSummaryDaoConfig.getIdentityScope().clear();
        extrasSummaryDaoConfig.getIdentityScope().clear();
        matchInningsDaoConfig.getIdentityScope().clear();
        matchesDaoConfig.getIdentityScope().clear();
    }

    public SubscriptionsDao getSubscriptionsDao() {
        return subscriptionsDao;
    }

    public MatchDetailsDao getMatchDetailsDao() {
        return matchDetailsDao;
    }

    public MatchResultsDao getMatchResultsDao() {
        return matchResultsDao;
    }

    public ActionCommentaryDao getActionCommentaryDao() {
        return actionCommentaryDao;
    }

    public ScoreLineDao getScoreLineDao() {
        return scoreLineDao;
    }

    public ScoringTemplatesDao getScoringTemplatesDao() {
        return scoringTemplatesDao;
    }

    public PlayerDao getPlayerDao() {
        return playerDao;
    }

    public BattingSummaryDao getBattingSummaryDao() {
        return battingSummaryDao;
    }

    public BowlingSummaryDao getBowlingSummaryDao() {
        return bowlingSummaryDao;
    }

    public ExtrasSummaryDao getExtrasSummaryDao() {
        return extrasSummaryDao;
    }

    public MatchInningsDao getMatchInningsDao() {
        return matchInningsDao;
    }

    public MatchesDao getMatchesDao() {
        return matchesDao;
    }

}
